package com.zhuyuan.system.controller;

import com.zhuyuan.core.util.Result;
import com.zhuyuan.database.base.BaseController;
import com.zhuyuan.security.util.SecurityUtils;
import com.zhuyuan.system.service.ISysMenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 张琳凯
 * @Description: TODO
 * @DateTime: 2025/2/9 17:37
 **/
@RestController
@RequestMapping("/menu")
@RequiredArgsConstructor
public class MenuController extends BaseController {

    private final ISysMenuService sysMenuService;

    @GetMapping("/getRouters")
    public Result<?> getRouters() {
        return Result.ok(sysMenuService.getRouterTreeByUid(SecurityUtils.getUserId()));
    }
}
